﻿using System.Collections.Generic;
using BlawkayEngine;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;

namespace BlawkayHockey
{
    public class Ice
    {

        public Ice(Game oGame, string oImagePath, float oLong, float oWide)
        {
            // Top
            Texture2D oTexture = oGame.Content.Load<Texture2D>(oImagePath);
            _Ground = new List<Quad>();

            Quad q;

            q = new Quad(oGame, oTexture, null, Vector3.Zero, new Vector3(-oLong * 0.25f, -0.2f, 0),
                VectorHelper.GLOBAL_UP, VectorHelper.GLOBAL_RIGHT, oWide, oLong * 0.5f, false);
            q.Effect.SpecularColor = new Vector3(0.325f, 0.325f, 0.325f);
            _Ground.Add(q);

            q = new Quad(oGame, oTexture, null, Vector3.Zero, new Vector3(oLong * 0.25f, -0.2f, 0),
                VectorHelper.GLOBAL_UP, VectorHelper.GLOBAL_RIGHT, oWide, oLong * 0.5f, false);
            q.Effect.SpecularColor = new Vector3(0.325f, 0.325f, 0.325f);
            _Ground.Add(q);
        }

        public void Update(Camera oCamera)
        {
            foreach(Quad q in _Ground)
                q.Update(oCamera);
        }

        public void DrawOpaque(Game oGame)
        {
            foreach (Quad q in _Ground)
                q.Draw(oGame);
        }


        List<Quad> _Ground;
    }

}
